package com.wangyadong.hobby.schedule.jobtask.jvm;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * <p>
 *
 * @author <714037465@qq.com>
 * @since 2018/11/2910:34
 **/
public class GenericTypes {

//    public static String method(List<String> list) {
//        return "";
//    }
//
//    public int method(List<Integer> list) {
//        return 0;
//    }


    public static void main(String[] args) {
        List<Integer> list = Arrays.asList(1, 2, 3, 4);
        int sum = 0;
        for (int i : list) {
            sum += i;
        }
        System.out.println(sum);
    }
    public static void main1(String[] args) {
        Integer a = 1;
        Integer b = 2;
        Integer c = 3;
        Integer d = 3;
        Integer e = 321;
        Integer f = 321;
        Long g = 3L;
        //true
        System.out.println(c == d);
        //false
        System.out.println(e == f);
        //true
        System.out.println(c == (a + b));
        //false or true?
        System.out.println(c.equals(a + b));
        //false
        System.out.println(g.equals(a + b));
    }
}
